<?php
class Status extends Controller {
	public function json() {
		$tid = $this->post('tid', 'int');
		$status = $this->post('status', 'int');
		
		if(!$tid) $this->displayJSON(array('status' => -1, 'message' => '未知门票'));

		$mTicket = new Ticket_model();
		$cols = array(
			'status' 		=> $status
		);
		$result = $mTicket->edit($tid, $cols);
		if($result) $this->displayJSON(array('status' => 0, 'message' => '更改门票状态成功'));
		else $this->displayJSON(array('status' => -2, 'message' => '更改门票状态失败'));
	}
}